package com.github.minglie.mingapiutils.utils;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import java.io.IOException;

public class OkHttpClientTemplateJava {


    public static OkHttpClient client = new OkHttpClient().newBuilder()
            .build();


    public static void main(String[] args) {

        try {

            Request request = new Request.Builder()
                    .url("http://localhost:8888/miApiListByPage?startPage=1&limit=1")
                    .method("GET", null)
                    .addHeader("authorization", "abcdefg")
                    .addHeader("userId", "1607616657000")
                    .build();
            Response response = null;

            response = client.newCall(request).execute();


            System.out.println(response.body().string());


        } catch (IOException e) {


            e.printStackTrace();
        }


    }


}
